package com.itheima.demo;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author Zhang_Han
 * @version 1.0
 * @date 2020/7/11 15:56
 */
public class Demo_CallAble_001 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        //创建任务对象;
        callAble ca = new callAble();
        //创建任务管理对象;
        FutureTask ft = new FutureTask<>(ca);
        //创建多线程;
        Thread t = new Thread(ft);
        //开启多线程;
        t.start();
        //获取结果;
        String o = (String) ft.get();
        System.out.println(o);
    }
}
